﻿using Fabrication.DataSources;

namespace Fabrication.ValueProviders
{
    internal sealed class AddressProvider : ValueProviderBase<string>
    {
        protected override string GetValue(object item)
        {
            var streetNumber = RandomNumberGenerator.GetInteger(1, 300);

            var streetNames = Streets.StreetNames;
            var streetName = streetNames[RandomNumberGenerator.GetInteger(0, streetNames.Count - 1)];

            var streetTypes = Streets.StreetTypes;
            var streetType = streetTypes[RandomNumberGenerator.GetInteger(0, streetTypes.Count - 1)];

            return string.Format("{0} {1} {2}", streetNumber, streetName, streetType);
        }
    }
}